package com.micro.ai.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serializable;

/**
 * 租户创建请求
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "租户创建请求")
public class TenantCreateRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "租户名称不能为空")
    @Size(min = 2, max = 100, message = "租户名称长度为2-100个字符")
    @Schema(description = "租户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "微AI科技")
    private String name;

    @NotBlank(message = "子域名不能为空")
    @Pattern(regexp = "^[a-z0-9][a-z0-9-]*[a-z0-9]$", message = "子域名格式不正确（只能包含小写字母、数字和连字符，且不能以连字符开头或结尾）")
    @Size(min = 3, max = 30, message = "子域名长度为3-30个字符")
    @Schema(description = "子域名", requiredMode = Schema.RequiredMode.REQUIRED, example = "micro-ai")
    private String subdomain;

    @NotBlank(message = "租户类型不能为空")
    @Schema(description = "租户类型：personal-个人, organization-组织", requiredMode = Schema.RequiredMode.REQUIRED, example = "organization")
    private String type;

    @Schema(description = "套餐类型：free-免费, basic-基础, premium-高级, enterprise-企业", example = "free")
    private String planType;

    @NotBlank(message = "联系邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @Schema(description = "联系邮箱", requiredMode = Schema.RequiredMode.REQUIRED, example = "contact@micro-ai.com")
    private String contactEmail;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Schema(description = "联系电话", example = "13800138000")
    private String contactPhone;

    @Schema(description = "网站", example = "https://micro-ai.com")
    private String website;

    @Schema(description = "国家", example = "中国")
    private String country;

    @Schema(description = "省份", example = "广东省")
    private String province;

    @Schema(description = "城市", example = "深圳市")
    private String city;

    @Schema(description = "地址", example = "南山区科技园")
    private String address;

    @Schema(description = "邮编", example = "518000")
    private String postalCode;
}

